from pyframe.exceptions.xml_serializable_exception import XmlSerializableException

class BlockMethod(object):

	_params = None

	def __init__(self, params = None):

		self._params = self._getDefaultParams()
		self._params.update(params)

	def _getDefaultParams(self):
		return {}

	def _hasParamByName(self, name):
		return self._params.has_key(name)

	def _getParamByName(self, name):

		if(not self._hasParamByName(name)):
			raise XmlSerializableException(name, 'required-param-not-found')

		return self._params[name]

	def run(self):
		pass